package kr.or.kosta.otr.persistence.interestreview;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;

import javax.annotation.Resource;

import kr.or.kosta.otr.vo.InterestReviewVO;

import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;
@Repository("InterestReviewDao")
public class InterestReviewDaoImpl implements InterestReviewDao{
	@Resource(name="sqlMapClient")
	private SqlMapClient sqlMapClient;
	
	
	@Override
	public void addInterestReview(InterestReviewVO vo) throws SQLException {
		sqlMapClient.insert("InterestReview.addInterestReview",vo);
	}

	@Override
	public void deleteInterestReview(HashMap<String, Object> map) throws SQLException {
		sqlMapClient.delete("InterestReview.deleteInterestReview",map);
	}

	@Override
	public ArrayList<InterestReviewVO> getAllInterestReview(String userId)
			throws SQLException {
		return (ArrayList<InterestReviewVO>) sqlMapClient.queryForList("InterestReview.getAllInterestReview",userId);
	}

	@Override
	public int myInterestReview(String userId) throws SQLException {
		// TODO Auto-generated method stub
		return (int) sqlMapClient.queryForObject("InterestReview.myInterestReview", userId);
	}

}
